package com.kong.client.model;

public class Answer
{
	private int value;

	private String description;
	
	private int nextQuestionId;
	
	private Question question;

	public Answer(int value, String description)
	{
		this(value, description, -1);
	}
	
	public Answer(int value, String description, int nextQuestionId)
	{
		this.value = value;
		this.description = description;
		this.nextQuestionId = nextQuestionId;
	}

	public String getDescription()
	{
		return description;
	}

	public int getValue()
	{
		return value;
	}

	Question getQuestion()
	{
		return question;
	}

	void setQuestion(Question question)
	{
		this.question = question;
	}
	
	public Question getNextQuestion()
	{
		if (nextQuestionId != -1)
		{
			return getQuestion().getModule().getQuestionById(nextQuestionId);
		}
		else
		{
			return getQuestion().getNextQuestion();
		}
	}
}
